package com.example.myspringframework.beans.factory;

import com.example.myspringframework.beans.BeansException;

/**
 * bean工厂的核心接口
 */
public interface BeanFactory {
    /**
     * 根据beanName获取bean
     */
    Object getBean(String beanName) throws BeansException;

    /**
     * 根据beanName和类型获取bean
     */
    <T> T getBean(String beanName, Class<T> requiredType) throws BeansException;

    /**
     * 根据类型获取bean
     */
    <T> T getBean(Class<T> requiredType) throws BeansException;

    /**
     * 根据beanName判断容器中是否存在bean
     */
    boolean containsBean(String beanName);
}